#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 100050;
int n, m;
int e[N], ne[N], h[N], idx;
int color[N];
void add (int a, int b){
	e[idx] = b, ne[idx] = h[a], h[a] = idx++;
}
bool dfs(int v, int c){
	for (int i = h[v]; i != -1; i = ne[i]){
		int b = e[i];
		if (!color[b]){
			color[b] = c;
			return dfs(b, 3 - c);
		} else {
			if (color[b] != 3 - c){
				return false;
			}
		}
	}
	return true;
}
int main (){
	memset(h, -1, sizeof h);
	cin >> n >> m;
	int a, b;
	while (m--) {
		add(a, b), add(b, a);
	}
	
	bool flag = true;
	for (int i = 1; i <= n; i++){
		if (!color[i]){
			if (!dfs(i, 1)){
				flag = false;
				break;
			}
		}
	}

	if (flag) cout << "Yes" <<endl;
	else cout << "No" << endl;
	return 0;
}
